package cn.openread;

import java.io.IOException;

/**
 * 1.为什么采用webp?webp占用空间小,传送更快,画质不降低
 * 2.webp转化这么麻烦?webp出世的时间太晚,好多地方都不支持
 * 3.为什么写这个项目？方便自己方便他人,避免绕弯路
 *
 * @author Simon
 * @see https://www.jb51.net/article/147135.htm
 * @see https://github.com/nintha/webp-imageio-core
 */
public class MainTest {

    /**
     * png->webp
     */
    public static void main2(String args[]) throws IOException {
        String webpImgPath = "D:\\simon-projects\\labs\\webp-transform\\src\\main\\resources\\2.webp";
        String pngImgPath = "D:\\simon-projects\\labs\\webp-transform\\src\\main\\resources\\2.png";
        String s = WebpKits.webp2png(webpImgPath, pngImgPath);
        System.out.println(s);
    }

    /**
     * webp->png
     */
    public static void main(String args[]) throws IOException {
        String pngImgPath = "D:\\simon-projects\\labs\\webp-transform\\src\\main\\resources\\2.png";
        String webpImgPath = "D:\\simon-projects\\labs\\webp-transform\\src\\main\\resources\\2_1.webp";
        String s = WebpKits.png2webp(pngImgPath, webpImgPath);
        System.out.println(s);
    }
}
